function MayorSetSalary(ply, cmd, args)
	if (CfgVars["mayorsetsalary"] == 0) then
		ply:PrintMessage(2, "Mayor SetSalary Disabled By Admin!")
		Notify(ply, 1, 3, "Mayor SetSalary Disabled By Admin!")
		return "Mayor SetSalary Disabled By Admin!"
	end

	if ply:Team() ~= TEAM_MAYOR then
		ply:PrintMessage(2, "You Must be Mayor to use this function!")
		return
	end

	local amount = math.floor(tonumber(args[2]))

	if (not amount) then
		if (ply:EntIndex() == 0) then
			Msg("Invalid Salary: " .. args[2])
		else
			ply:PrintMessage(2, "Invalid Salary: " .. args[2])
		end
		return
	end

	if (amount > GetGlobalInt("mayorsetsalary")) then
		if (ply:EntIndex() == 0) then
			Msg("Salary must be below " .. CUR .. GetGlobalInt("mayorsetsalary") .. "!")
		else
			ply:PrintMessage(2, "Salary must be below: " .. CUR .. GetGlobalInt("mayorsetsalary") .."!")
		end
		return
	end

	local target = FindPlayer(args[1])

	if target then
		if target:Team() == TEAM_MAYOR then
			Notify(ply, 1, 3, "Can not set the Mayor's salary!")
			return "Can not set the Mayor's salary!"
		elseif target:Team() == TEAM_POLICE or target:Team() == TEAM_CHIEF then
			if (amount > GetGlobalInt("maxcopsalary")) then
				return "Police salary Limit: " .. CUR .. GetGlobalInt("maxcopsalary") .. "!"
			else
				local nick = ""
				DB.StoreSalary(target, amount)
				target:SetNWInt("salary", amount)
				if (ply:EntIndex() == 0) then
					Msg("Set " .. target:Nick() .. "'s Salary to: " .. CUR .. amount)
					nick = "Console"
				else
					ply:PrintMessage(2, "Set " .. target:Nick() .. "'s Salary to: " .. CUR .. amount)
					nick = ply:Nick()
				end
				target:PrintMessage(2, nick .. " set your Salary to: " .. CUR .. amount)
			end
		elseif target:Team() == TEAM_CITIZEN or target:Team() == TEAM_GUN or target:Team() == TEAM_MEDIC or target:Team() == TEAM_COOK then
			if (amount > GetGlobalInt("maxnormalsalary")) then
				return "Normal Player salary Limit: " .. CUR .. GetGlobalInt("maxnormalsalary") .. "!"
			else
				local nick = ""
				DB.StoreSalary(target, amount)
				target:SetNWInt("salary", amount)
				if (ply:EntIndex() == 0) then
					Msg("Set " .. target:Nick() .. "'s Salary to: " .. CUR .. amount)
					nick = "Console"
				else
					ply:PrintMessage(2, "Set " .. target:Nick() .. "'s Salary to: " .. CUR .. amount)
					nick = ply:Nick()
				end
				target:PrintMessage(2, nick .. " set your Salary to: " .. CUR .. amount)
			end
		elseif target:Team() == TEAM_GANG or target:Team() == TEAM_MOB then
			return "Mayor can not set a Gang or a Mob's salary"
		else
			return "Player Not on a Team Yet!"
		end
	elseif (ply:EntIndex() == 0) then
		Msg("Did not find player: " .. args[1])
	else
		ply:PrintMessage(2, "Did not find player: " .. args[1])
	end
	return
end
concommand.Add("mayor_setsalary", MayorSetSalary)

function MayorSetCPBudget(ply, cmd, args)
	local amount = math.floor(tostring(args[1]))
	if ply:Team() ~= TEAM_MAYOR then
		Notify(ply, 1, 3, "You must be Mayor to Use this function")
		return
	else
		if amount > GetGlobalInt("maxcpbudget") then
			Notify(ply, 1, 3, "Maximum CP budget: " .. GetGlobalInt("maxcpbudget") .. "")
			return
		else
			SetCPBudget(amount)
			Notify(ply, 1, 3, "Civil Protection Budget Set To: " .. CUR .. amount .. "")
			return "Civil Protection Budget Set To: " .. CUR .. amount .. ""
		end
	end
end
concommand.Add("mayor_setcpbudget", MayorSetCPBudget)

function SetBail(target, amount)
	local IDSteam = string.gsub(target:SteamID(), ":", "")
	file.Write("DarkRP/temp/" .. IDSteam .. ".txt", math.floor(amount))
	target:SetNWFloat("mybail", math.floor(amount))
end
concommand.Add("cp_setbail", SetBail)

function CPSetBail(ply, cmd, args)
	if ply:Team() ~= TEAM_CHIEF then
		Notify(ply, 1, 4, "You must be Police Chief to use this function!")
		return "You Must be Police Chief to use this function!"
	end

	local setterID = string.gsub(ply:SteamID(), ":", "")
	if file.Exists("DarkRP/temp/jail/" .. setterID .. ".txt") then
		Notify(ply, 1, 4, "Police Chief can not set Bails while Arrested!")
		return "Police Chief can not set Bails while Arrested!"
	end

	local amount = math.floor(tonumber(args[2]))

	if (not amount) then
		if (ply:EntIndex() == 0) then
			Msg("Invalid Bail: " .. args[2])
		else
			ply:PrintMessage(2, "Invalid Bail: " .. args[2])
		end
		return
	end

	if (amount > GetGlobalInt("maxbail")) then
		if (ply:EntIndex() == 0) then
			Msg("Bail must be below " .. CUR .. GetGlobalInt("maxbail") .. "!")
		else
			ply:PrintMessage(2, "Bail must be below: " .. CUR .. GetGlobalInt("maxbail") .."!")
		end
		return
	end
	local target = FindPlayer(args[1])

	if (target) then
		if (file.Exists("DarkRP/temp/jail/" .. setterID .. ".txt"))then
			SetBail(target, amount)
			Msg("Player: " .. target .. "'s Bail Set To: " .. amount .. " Seconds")
		else
			return "Player Has To Be Arrested to Have a Bail!"
		end
	elseif (ply:EntIndex() == 0)then
		Msg("Did not find player: " .. args[1])
	else
		ply:PrintMessage(2, "Did not find player: " .. args[1])
	end
	return
end
concommand.Add("cp_setbail", CPSetBail)